<?php
include("config.php");
include("connection/connection.php");
 if(isset($_REQUEST['submit'])){
 // print_r($_REQUEST);
  $distId =  $_REQUEST['district_id'];
  $lpcd=$_REQUEST['service'];
  $pop = $_REQUEST['population']*$lpcd;
// echo $pop;
	$res=mysql_query("UPDATE tbl_dtls_q1_main SET population = '$_REQUEST[population]' , water_demand = '$pop'  WHERE id = '$_REQUEST[main_id]'");
 if($res)
  { 
  header("Location: q1_rwss_edit.php");
  }
  }		
?>
<script type="text/javascript" src="js/jquery.js"></script>

 <div class="section_format">
  <form action="populationrwss_insert.php" method="post" name="sec5" id="sec5" >
  <input type="hidden" id="main_id" name="main_id" value="<?php echo $_REQUEST['id']; ?>" />
    <input type="hidden" id="district_id" name="district_id" value="<?php echo $_REQUEST['dis']; ?>" />
	<div style="height:30px" align="center"><?php echo $_REQUEST['ref']; ?></div>
   <table border="1">
    <tr>
      <td colspan="2">&nbsp;</td>
      </tr>
	   <tr>
      <td width="138">&nbsp;<b>Population</b></td>
      <td width="144">&nbsp;
	  
	  

		<input type="text" name="population" id="population" value="<?php echo $_REQUEST['val']; ?>" />		</td>
      </tr>
	   <tr>
	     <td>&nbsp;<b>Service Level</b></td>
	     <td>&nbsp;
		 <select name="service" id="service">
		  <option value="0">==Select service level==</option>
		  <option value="0.04">40</option>
		  <option value="0.07">70</option>
		 </select>
		 </td>
      </tr>

	  
	  <tr>
	    <td colspan="2" align="center"><input type="submit"  value="Save Population" name="submit" style="font-size: 8pt; font-family: Verdana; border-style: solid; border-width: 1px; font-weight:bold; background:#666666; color:#FFFFFF; width:140px; height:30px" onClick="view_validate()"></td>
  </tr>
  </table>

   </form>
  </div>
 